#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;

class Solution {
public:
    int findPeakElement(vector<int>& nums)
    {
        int left = 0;
        int right = nums.size() - 1;
        while (left < right)
        {
            int mid = left + (right - left) / 2;
            if (nums[mid] < nums[mid + 1])left = mid + 1;
            else right = mid;
        }
        return left;
    }
};

int main()
{
    int nums[] = { 1,2,1,3,5,6,4 };
    vector <int> m;
    for (auto& e : nums)m.push_back(e);
    Solution s;
    cout << s.findPeakElement(m) << endl;
    return 0;
}
